import fetch from '@/utils/fetch'

// 产品Excel导出
export function apiProductWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/product/write',
    method: 'POST',
    data: listQuery
  })
}

// 物料Excel导出
export function apiMaterialWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/materiel/write',
    method: 'POST',
    data: listQuery
  })
}

// 故障Excel导出
export function apiFaultWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/fault/write',
    method: 'POST',
    data: listQuery
  })
}

// 工厂Excel导出
export function apiFactoryWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/factory/write',
    method: 'POST',
    data: listQuery
  })
}

// 外包商Excel导出
export function apiOutsourcerWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/outsourcer/write',
    method: 'POST',
    data: listQuery
  })
}

// 客户Excel导出
export function apiCustomerWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/customer/write',
    method: 'POST',
    data: listQuery
  })
}

// 员工Excel导出
export function apiStaffWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/staff/write',
    method: 'POST',
    data: listQuery
  })
}

// 用户Excel导出
export function apiUserWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/user/write',
    method: 'POST',
    data: listQuery
  })
}

// 办事处Excel导出
export function apiOfficeWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/office/write',
    method: 'POST',
    data: listQuery
  })
}

// 受理Excel导出
export function apiAcceptWriteExcel(listQuery) {
  return fetch({
    url: '/api/v1/excel/accept/write',
    method: 'POST',
    data: listQuery
  })
}

export function apiDownloadExcel(listQuery) {
  return fetch({
    url: '/api/v1/download',
    method: 'GET',
    params: listQuery
  })
}

// 全流程维修数据导出
export function apiWholeProcessExcel(listQuery) {
  return fetch({
    url: 'api/v1/maintenanceRecord/whole/process/record/write',
    method: 'GET',
    params: listQuery,
    responseType: 'arraybuffer'
  })
}
